import { Controller, Get, Req, UseGuards } from "@nestjs/common";
import { UserService } from "../service/user.service";
import { AuthGuard } from "@nestjs/passport";
import { Request } from "express";
import { jsonBaseResponse } from "../utils/response/response";

@Controller("/api/user")
@UseGuards(AuthGuard("jwt"))
export class UserController {
  constructor(
    private readonly userService: UserService
  ) {
  }

  @Get("/getProfile")
  async getProfile(@Req() req: Request) {
    return jsonBaseResponse(req.user['user']);
  }
}
